<template>
  <div class="form-setting-panel">
    <!-- start 标题 -->
    <h3 class="form-setting-panel-title">{{field.displayName}}</h3>   
    <p class="form-design-warning">{{$t('common.form.tip.systemTemplateCantDeleteTips')}}</p>
    <!-- end 标题 -->
    
    <!-- 默认币种 -->
    <h3 class="form-setting-panel-title">{{$t('common.currency.defaultCurrency')}}</h3>   
    <el-select class='sale-price-select' v-model="defalutCurrency" @input="update(defalutCurrency, 'defalutCurrency', true)" :placeholder="$t('common.placeholder.select')">
      <el-option
        v-for="item in currencyOption"
        :key="item.value"
        :label="item.label"
        :value="item.value"
        >
      </el-option>
    </el-select>
  </div>
</template>

<script>
/* mixin */
import SettingMixin from '@src/component/form/mixin/setting';
/* props */
import { settingProps } from '@src/component/form/components/props';
import { currencyOption } from '@src/util/currency'
export default {
  name: 'FormCurrencyTypeSetting',
  mixins: [SettingMixin],
  props: settingProps,
  data() {
    return {
      currencyOption,
      defalutCurrency: this.field.setting.defalutCurrency || 'CNY'
    }
  },
  methods: {
    update(value, prop, isSetting = false) {
      this.$emit('input', {value, prop, isSetting});
    }
  },
  mounted() {
    this.update(this.defalutCurrency, 'defalutCurrency', true)
  }
}
</script>
